import PageTitle from './textComp/PageTitle'

const pageTitleConf = {
    title: '文本',
    type: 'questionPageTitle',
    component: <PageTitle></PageTitle>,
    defaultProps: {
        text: '',
        desc: '',
        isCenter: '',
    },
}

const componentList = [pageTitleConf]

export function getComponent(comp: any) {
    const { id, type } = comp
    const component = componentList.find(item => item.type === type)?.component
    if (!component) {
        throw new Error('没有该组件，请重新定义')
    }
    return component
}